<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <style media="screen">
      #div1 {background:#CCC;width:100px;height:100px}
    </style>
    <script type="text/javascript">
      window.onload= function()
      {
        let oTxt = document.getElementById('txt1');
        let oDiv= document.getElementById('div1');

        oTxt.oninput=function()
        {
          oDiv.innerHTML=oTxt.value;
        };
      };
    </script>
  </head>
  <body>
    <input type="text" name="" value="" id="txt1" >
    <div id="div1">

    </div>
  </body>
</html>
